#ifndef FILERECEIVER_H
#define FILERECEIVER_H

#include <QTcpServer>
#include <QTcpSocket>
#include <QFile>
#include <QFileInfo>

class TcpServer : public QTcpServer
{
    Q_OBJECT

public:
    static TcpServer *getInstance();

protected:
    void incomingConnection(int handle);

private:
    TcpServer(QObject *parent = 0);
};

class FileReceiver : public QTcpSocket
{
    Q_OBJECT

public:
    FileReceiver(QObject *parent = 0);

private slots:
    void processReadyRead();

signals:
    void fileReceived(const QString &filePath);

private:
    quint64 nextBlockSize;
};

#endif // FILERECEIVER_H
